using System;
using System.Threading.Tasks;

namespace MT5Trade
{
    class RunTestDirect
    {
        static async Task Main(string[] args)
        {
            Console.WriteLine("开始运行MT5连接测试...\n");

            var tester = new ConnectionTest();

            try
            {
                await tester.RunAllTests();
            }
            catch (Exception ex)
            {
                Console.WriteLine($"\n测试过程中出错: {ex.Message}");
                Console.WriteLine($"堆栈跟踪: {ex.StackTrace}");
            }
            finally
            {
                tester.Cleanup();
            }

            Console.WriteLine("\n测试完成。按任意键退出...");
            Console.ReadKey();
        }
    }
}